@extends('admin.layout.main')

@section('content')
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
<ul class="breadcrumb">
	<li>
		<i class="ace-icon fa fa-home home-icon"></i>
		<a href="#">首页</a>
	</li>
	<li><a href="#">法币交易</a></li>
	<li class="active"><a href="{{ url('admin/unbind_list') }}">商家解绑申请列表</a></li>
</ul><!-- /.breadcrumb -->

</div>
<div class="page-content">
	<div class="row">
		<div class="col-xs-12">
			<div class="row">
				<div class="search-area well col-xs-12">
					<form action="">
						<div class="pull-left">
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<i class="icon-only ace-icon fa fa-th"></i>
							<b class="text-primary">会员ID: </b>
							&nbsp;
							<div id="toggle-result-format" class="btn-group btn-overlap" data-toggle="buttons">
								<input type="text" name="account"/>
							</div>

							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<button type="submit" class="btn btn-white btn-info btn-bold">查询</button>
						</div>
					</form>
				</div>
			</div>


			<!-- PAGE CONTENT BEGINS -->
			<div class="row">
				<div class="col-xs-12">
					<!-- div.table-responsive -->
					<!-- div.dataTables_borderWrap -->
					<div>
						<table id="dynamic-table" class="table table-striped table-bordered table-hover">
							<thead>
								<tr>
									<th>序号</th>
									<th>会员ID</th>
									<th>总交易额（元）</th>
									<th>近30日交易额（元）</th>
									<th>申请时间</th>
									<th>状态</th>
									<th>操作</th>
								</tr>
							</thead>

							<tbody>
								@if($data->count() > 0)
								@foreach($data as $key=>$value)
									<tr>
                                        <td>{{$key+$page_num}}</td>
                                        <td>{{$value->user->account}}</td>
                                        <td>{{$value->user->recharges->sum('total_price')}}</td>
                                        <td>{{$value->user->thirty_summary->sum('total_price')}}</td>
                                        <td>{{$value->created_at}}</td>
                                        <td>{{\App\Models\Unbind::$STATUS[$value->status]}}</td>
                                        <td>
                                            @if($value->status==1)
                                            <a href="/admin/unbind_business?uid={{$value->uid}}">
                                                <button class="btn btn-xs btn-info">
													<i class="ace-icon fa fa-pencil bigger-120">注销商家</i>
												</button>
                                            </a>
                                            @endif
                                        </td>
									</tr>
								@endforeach
								@endif
							</tbody>
						</table>
					</div>
				</div>
			</div>
			<!-- PAGE CONTENT ENDS -->
		</div><!-- /.col -->

	</div><!-- /.row -->
	<div class="no-margin-top">
		<ul class="pagination pull-right no-margin">
			{{$data->appends(['account'=>$account])->links()}}
		</ul>
	</div>
</div><!-- /.page-content -->

@endsection
